//
//  BMAArtist.m
//  LZMusicPlayer
//
//  Created by wulanzhou on 2016/11/1.
//  Copyright © 2016年 wulanzhou. All rights reserved.
//

#import "BMAArtist.h"

@implementation BMAArtist

/**
 * 获取艺术家列表
 * @param offset	偏移
 * @param limit		数量
 * @param areaType	地区：0不分,6华语,3欧美,7韩国,60日本,5其他
 * @param sexType	性别：0不分,1男,2女,3组合
 * @param order		排序：1按热门，2按艺术家id
 * @param abc		艺术家名首字母：a-z,other其他
 * @return
 */
- (NSString *) artistList:(int)offset limit:(int)limit area:(BMAAreaType)areaType sex:(BMASexType)sexType order:(int)order abc:(NSString *)abc{
    
    NSMutableString *sb = [[NSMutableString alloc] initWithString:[self baseURLString]];
    [sb appendString:@"&method=baidu.ting.artist.getList"];
    [sb appendFormat:@"&offset=%d",offset];
    [sb appendFormat:@"&limit=%d",limit];
    [sb appendFormat:@"&area=%d",areaType];
    [sb appendFormat:@"&sex=%d",sexType];
    [sb appendFormat:@"&order=%d",order]; //暂时不清楚order排序
    
    if (abc&&[abc isKindOfClass:[NSString class]]&&[abc length]>0) {
        [sb appendFormat:@"&abc=%@",abc];
    }

    return sb;
}

/**
 * 热门艺术家
 * @param offset	偏移量
 * @param limit		获取数量
 * @return
 */
- (NSString *) hotArtist:(int)offset limit:(int)limit{
    return [self artistList:offset limit:limit area:0 sex:0 order:1 abc:nil];
}

/**
 * 艺术家歌曲 （获取歌手歌曲列表）
 * @param tinguid	tinguid
 * @param artistid	艺术家id
 * @param offset	偏移量
 * @param limit		获取数量
 * @return
 */
- (NSString *) artistSongList:(NSString *)tinguid artistid:(NSString *)artistid offset:(int)offset limit:(int)limit{
    
    NSMutableString *sb = [[NSMutableString alloc] initWithString:[self baseURLString]];
    [sb appendString:@"&method=baidu.ting.artist.getSongList"];
    [sb appendString:@"&order=2"];
    [sb appendFormat:@"&tinguid=%@",tinguid];
    [sb appendFormat:@"&artistid=%@",artistid];
    [sb appendFormat:@"&offset=%d",offset];
    [sb appendFormat:@"&limits=%d",limit];
    
    return sb;
}

/**
 * 艺术家信息  （歌手信息）
 * @param tinguid	tinguid
 * @param artistid	艺术家id
 * @return
 */
- (NSString *) artistInfo:(NSString *)tinguid artistid:(NSString *)artistid{
    NSMutableString *sb = [[NSMutableString alloc] initWithString:[self baseURLString]];
    [sb appendString:@"&method=baidu.ting.artist.getinfo"];
    [sb appendFormat:@"&tinguid=%@",tinguid];
    [sb appendFormat:@"&artistid=%@",artistid];
    
    return sb;
}

@end
